
import 'package:flutter/material.dart';

import 'container_or_text/index.dart';
import 'grid/index.dart';
import 'icon/index.dart';
import 'image/index.dart';
import 'list/index.dart';
import 'padding_row_column_flex/index.dart';
import 'stack/index.dart';

Map exampleRoutes = {
  '/container_or_text': (context) => const ContainerOrText(),
  '/image': (context) => const Img(),
  '/icon': (context) => const IconDome(),
  '/list': (context) => ListDome(),
  '/grid': (context) => Grid(),
  '/pad': (context) => Pad(),
  '/stack': (context) => StackDome(),
};

var onGenerateRoute = (RouteSettings settings) {
  final String? name = settings.name;
  final Object? arguments = settings.arguments;
  final Function? pageBuilder = exampleRoutes[name];

  if (pageBuilder == null) return null;
  final Route route = MaterialPageRoute(
    builder: (context) => (arguments != null?pageBuilder(context,arguments):pageBuilder(context))
  );

  return route;
};
